package com.atguigu.eduservice.service.impl;

import com.atguigu.eduservice.entity.EduVideo;
import com.atguigu.eduservice.mapper.EduVideoMapper;
import com.atguigu.eduservice.service.EduVideoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 课程视频 服务实现类
 * </p>
 *
 * @author testjava
 * @since 2023-03-05
 */
@Service
public class EduVideoServiceImpl extends ServiceImpl<EduVideoMapper, EduVideo> implements EduVideoService {

    @Autowired
    private EduVideoService eduVideoService;

    /**
     * 得到章节对应的小节
     * @param chapterId
     * @return
     */
    @Override
    public List<EduVideo> getEduVideo(String chapterId) {
       QueryWrapper<EduVideo> wrapper=new QueryWrapper();
       wrapper.eq("chapter_id",chapterId);
        List<EduVideo> list = eduVideoService.list(wrapper);
        return list;
    }
}
